package cz.cvut.manatee.processManager;

import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.XMLConfiguration;

import java.io.File;
import java.io.IOException;

public class Config extends XMLConfiguration {
	private static final long serialVersionUID = 1L;

	Config(String configFile) throws IOException {
		File file = new File(configFile);
		if (!file.canRead()) throw new IOException("Konfiguracni soubor neexistuje nebo neni read.");
		
		setFileName(configFile);
		try {
			load();
		} catch (ConfigurationException configEx) {
			throw new IOException("Konfiguracni soubor je poskozeny.");
		}
	}
}
